package cn.hackcloud.designpattern.command;

public class Client {
	public static void main(String[] args) {
		LightReceiver receiver=new LightReceiver();
		
		LightOnCommand lightOnCommand = new LightOnCommand(receiver);
		LightOffCommand lightOffCommand = new LightOffCommand(receiver);
		Invoker invoker=new Invoker();
		invoker.setCommand(0, lightOnCommand, lightOffCommand);
		invoker.onButton(0);
		invoker.offButton(0);
		invoker.undoButton();
	}
}
